In the field of cryptography, symmetric-key algorithms use the same cryptographic keys for both encryption and decryption. The keys may be identical or related by a transformation between the two keys. The keys are a shared secret between two or more parties that can be used for secure communications.
Symmetric-key algorithms require both a sender and a recipient of a message to have the same secret key. Early cryptographic systems required one of the parties to receive a copy of the secret key over a physically-secure channel.
Modern cryptographic systems use symmetric-key algorithms to encrypt messages. Symmetric-key algorithms are also used to offer, for example, authentication services, message integrity services, data integrity services, which are all based on use of a secret key in conjunction with a MAC (Message Authentication Code) algorithm. Examples of MAC algorithms include HMAC-SHA256, PMAX, CMAC, MAA, etc). In some cases, a Diffie-Hellman key exchange or some other public-key protocol is used to securely agree on a fresh new secret key for each message.
When used with asymmetric ciphers for key transfer, pseudorandom key generators are typically used to generate the public and private keys needed for the asymmetric transfer of the secret key. However, lack of randomness in those generators can lead to problems (e.g., a security breach). Typically, it is desirable that an implementation use a source of high entropy for its initialization.